package com.vcc.service.boss.response.regulation;

import com.vcc.service.boss.response.baseVo.BossBaseVo;
import com.vcc.core.util.DateUtil;
import com.vcc.core.util.StringUtil;
import com.vcc.data.entity.Regulation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;

@EqualsAndHashCode(callSuper = true)
@Data
@Setter
@Getter
public class RegulationVoBoss extends BossBaseVo implements Serializable {

    private String type;

    private String account;

    private Long userId;

    private Integer useFlag;
    private String amountType;
    private BigDecimal amount;
    private String currencyCode;
    private Long cardId;
    private String cardNumber;
    private String remark;
    private String requestDate;
    private Long operationUserId;
    private String operationAccount;
    private String dealerAccount;

    public RegulationVoBoss(){}

    public RegulationVoBoss(Regulation regulation){
        super.setId(regulation.getId());
        this.type = regulation.getType();
        this.account = regulation.getAccount();
        this.userId = regulation.getUserId();
        this.useFlag = regulation.getUseFlag();
        this.amount = regulation.getAmount();
        this.currencyCode = regulation.getCurrencyCode();
        this.cardId = regulation.getCardId();
        this.cardNumber = StringUtil.hideCardNumber(cardNumber);
        this.remark = regulation.getRemark();
        this.requestDate = DateUtil.format(regulation.getRequestDate());
        this.operationUserId = regulation.getOperationUserId();
        this.operationAccount = regulation.getOperationAccount();
        this.amountType = regulation.getAmountType();
        this.dealerAccount = regulation.getDealerAccount();
    }
}
